﻿@page
@{ Layout = "_Layout"; }

<div style="padding:0 11px;">
    <div>
        <el-form v-on:submit.native.prevent :inline="true" :size="euiSize">
            <el-form-item label="关键字">
                <el-input v-model="form.keywords" placeholder="组织、用户名、姓名" prefix-icon="el-icon-search" clearable></el-input>
            </el-form-item>
            <el-form-item label="获证日期：从">
                <el-date-picker v-model="form.dateFrom"
                                type="datetime"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                placeholder="选择开始日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="到">
                <el-date-picker v-model="form.dateTo"
                                type="datetime"
                                value-format="yyyy-MM-dd HH:mm:ss"
                                placeholder="选择截止日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item>
                <el-button :size="euiSize" icon="el-icon-search" type="primary" v-on:click="btnSearchClick">查 询</el-button>
                <el-button :size="euiSize" plain type="primary" icon="el-icon-download" v-on:click="btnCerExportClick">
                    导 出
                </el-button>
                <el-button icon="el-icon-download" plain type="primary" v-on:click="btnCerZipClick" v-if="total>0">证书下载</el-button>
            </el-form-item>
        </el-form>
    </div>
    <div>
        <el-table ref="userTable" :data="list" :size="euiSize"
                  style="width: 100%">
            <el-table-column label="#"
                             type="index"
                             width="60"
                             align="left">
                <template scope="scope">
                    <span>{{(form.pageIndex - 1) * form.pageSize + scope.$index + 1}}</span>
                </template>
            </el-table-column>
            <el-table-column label="证书编号">
                <template slot-scope="scope">
                    <el-link type="primary" v-on:click="btnViewCer(scope.row)">{{scope.row.cerNumber}}</el-link>
                </template>
            </el-table-column>
            <el-table-column label="答卷">
                <template slot-scope="scope">
                    <el-link type="primary" v-on:click="btnUserPaperView(scope.row.examStartId)">{{scope.row.paper.title}}</el-link>
                </template>
            </el-table-column>
            <el-table-column label="账号">
                <template slot-scope="scope">
                    <el-link type="primary" v-on:click="utils.openUserView(scope.row.user.id)">{{scope.row.user.userName}}</el-link>
                </template>
            </el-table-column>
            <el-table-column prop="user.displayName" label="姓名">
            </el-table-column>
            <el-table-column prop="user.organNames" label="组织" show-overflow-toolti>
            </el-table-column>
            <el-table-column label="获证日期" width="180" prop="createdDate" align="right">
            </el-table-column>
            @await Html.PartialAsync("_PartialTableEmpty")
        </el-table>

        <div style="text-align: center; margin-top: 10px;">
            <el-pagination v-on:current-change="userHandleCurrentChange" background
                           :current-page="form.pageIndex"
                           :page-size="form.pageSize"
                           layout="total, prev, pager, next"
                           :total="total">
            </el-pagination>
        </div>
    </div>
</div>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/exam/examCerUsers.js" type="text/javascript"></script>
}